const path = require('path')

module.exports = {
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [
        //这个是加上自己的路径，
        //注意：试过不能使用别名路径
        path.resolve(__dirname, './src/assets/variable.less')
      ]
    }
  },
  // 配置别名
  configureWebpack: {
    resolve: {
      alias: {
        assets: '@/assets',
        components: '@/components',
        network: '@/network',
        request: '@/request',
        views: '@/views',
        style: '@/style',
        util: '@/util'
      }
    }
  },
  devServer: {
    hot: true,
    host: '0.0.0.0',
    // host: '192.168.3.139',
    // host: 'localhost',
    port: 8080,
    // externals: ['electron-edge-js'],
    proxy: {
      '/api': {
        target: 'http://www.gy1213.cn',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/'
        }
      }
    }
  }
}
